package cn.stylefeng.guns.modular.order.mapper;

import cn.stylefeng.guns.modular.order.entity.TbFreight;
import cn.stylefeng.guns.modular.order.model.params.TbFreightParam;
import cn.stylefeng.guns.modular.order.model.result.TbFreightResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 运费表 Mapper 接口
 * </p>
 *
 * @author zhou
 * @since 2019-08-05
 */
@Repository
public interface TbFreightMapper extends BaseMapper<TbFreight> {

    /**
     * 获取列表
     *
     * @author zhou
     * @Date 2019-08-05
     */
    List<TbFreightResult> customList(@Param("paramCondition") TbFreightParam paramCondition);

    /**
     * 获取map列表
     *
     * @author zhou
     * @Date 2019-08-05
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") TbFreightParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author zhou
     * @Date 2019-08-05
     */
    Page<TbFreightResult> customPageList(@Param("page") Page page, @Param("paramCondition") TbFreightParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author zhou
     * @Date 2019-08-05
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") TbFreightParam paramCondition);

    /**
     * 根据区域和目的地获取运费
     * @param param
     * @return
     */
    TbFreightResult getFreightByAreaAndDestination(TbFreightParam param);

    /**
     * 根据id查询重量与价格
     * @param id
     * @return
     */
    TbFreightResult getWeightPriceById(Integer id);

    /**
     * 根据id查询重量与价格
     * @param page
     * @param paramCondition
     * @return
     */
    Page<TbFreightResult> getWeightPriceList(@Param("page") Page page, @Param("paramCondition") TbFreightParam paramCondition);


    TbFreightResult  freight(@Param("area") String area);

    void add(@Param("paramCondition") TbFreightParam paramCondition);

    List<TbFreightResult>  moenyByCity(@Param("paramCondition") TbFreightParam paramCondition);
}
